<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .container{
            width: 600px;
            height: 500px;
            position: relative;
            border: 2px solid #aaa;
        }
        .container div{
            width: 100px;
            height: 100px;
            position: absolute;
            top: 50%;
            left: 50%;
        }
        .child{
        background: red;
        color:#fff;
        transform: translate(-50%,-50%);
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="child">child</div>
    </div>
</body>
</html>